import time


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

driver = webdriver.Edge()

# driver.get("http://www.baidu.com")
# time.sleep(1)

# driver.set_window_size(1000,500)
# time.sleep(1)
# driver.execute_script("window.scrollTo(200,0)")
# time.sleep(1)
# driver.execute_script("window.scrollTo(200,300)")
# time.sleep(1)
# driver.execute_script("window.scrollTo(document.body.scrollWidth,300)")
# time.sleep(1)
# driver.execute_script("window.scrollTo(document.body.scrollWidth, document.body.scrollHeight)")
# time.sleep(1)
# driver.execute_script("window.scrollTo(0,document.body.scrollHeight)")
# time.sleep(1)
# driver.execute_script("window.scrollTo(0,0)")
# time.sleep(5)

driver.get("http://127.0.0.1/ranzhi/www")
time.sleep(1)

input1 = driver.find_element("id","account")
driver.execute_script("arguments[0].setAttribute('style','display:none');",input1)
time.sleep(3)
try:
    input1.send_keys('admin')
except Exception as e:
    print(e)
driver.execute_script("arguments[0].setAttribute('style','display:block');",input1)
time.sleep(3)
driver.execute_script("arguments[0].removeAttribute('style','display:none');",input1)
time.sleep(30)